package guij.controller;

import guij.dao.mapper.ItemMapper;
import guij.taobao.TopInterface;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import com.taobao.api.model.Item;

public class GetRSSItems  implements Controller{

	@Override
	public ModelAndView handleRequest(HttpServletRequest arg0,
			HttpServletResponse arg1) throws Exception {
		
		String nikc = arg0.getSession().getAttribute("nick").toString();
		List<Item> rssItems = itemMapper.selectByNick(nikc);
		return new ModelAndView(getViewPage(),"rssItems",rssItems);
	
	}
	
	public void setViewPage(String viewPage) {
		this.viewPage = viewPage;
	}
	public String getViewPage() {
		return viewPage;
	}

	private String viewPage;
	private ItemMapper itemMapper;
	public ItemMapper getItemMapper() {
		return itemMapper;
	}

	public void setItemMapper(ItemMapper itemMapper) {
		this.itemMapper = itemMapper;
	}

}
